﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Web.Security;

namespace ProjectEF6
{
    /// <summary>
    /// Interaction logic for NewUser.xaml
    /// </summary>
    public partial class NewUser : Window
    {
        public NewUser()
        {
            InitializeComponent();
            Membership.DeleteUser("Martinovdz");
        }
        

        private void btnCreateUser_Click(object sender, RoutedEventArgs e)
        {
            string user, password;
            user = txtNewUser.Text;
            password = txtNewPassword.Password;
            MembershipUser newUser = Membership.CreateUser(user,password);
            if(newUser.IsApproved == true){
                MessageBox.Show("User Created!");
                this.Close();
            }
        }
    }
}
